<div class="page page-profile">
  <div class="page-content">
    <form name="profileForm" class="bhz-form">
      <div class="form-group avatar" ng-if="!requiredOnly">
        <label class="label">我的头像</label>
        <div class="avatar-wrap">
          <img ng-src="{{profile.avatar}}">
        </div>
      </div>
      <div ng-if="!requiredOnly" class="form-group form-group-inline gender">
        <label class="label">性  别</label>
        <span class="gender-image male" ng-if="profile.gender==0" ng-click="profile.gender=1"></span>
        <span class="gender-image female" ng-if="profile.gender==1" ng-click="profile.gender=0"></span>
      </div>
      <div ng-click="managerAddress()" class="form-group form-group-inline address">
        <label class="label"><span class="star">*</span>收货地址</label>
        <span class="address-detail" ng-if="profile.address_id!=0">{{defaultAddress.country + defaultAddress.zone + defaultAddress.city + defaultAddress.address}}</span>
        <span class="add-address icon-add" ng-if="profile.address_id==0"></span>
        <input type="hidden" ng-model="profile.address_id"></input>
      </div>
      <div class="form-group form-group-inline userinfo">
        <label class="label"><span class="star">*</span>联系人</label>
        <input type="text" name="fullname" class="bhz-input form-control input-fullname" ng-model="profile.fullname" placeholder="请输入名称" maxlength="12">
      </div>
      <div class="form-group form-group-inline company">
        <label class="label"><span class="star">*</span>公司名称</label>
        <input type="text" name="sms" class="bhz-input form-control" ng-model="profile.company_name" placeholder="请输入您的公司名称">
      </div>
      <div class="form-group bhz-select shop-type">
        <span class="label"><span class="star">*</span>终端类型：</span>
        <span class="input-wrap">
          <select dir="rtl" name="shop-type" class="input-select" ng-model="profile.shop_type">
            <!--<option value="1">卖场连锁</option>
            <option value="2">超市(500平米以上)</option>
            <option value="3">其他终端</option>-->
            <option value="4">区域正规大型连锁</option>
            <option value="5">1千平米以上单店及私人连锁</option>
            <option value="6">500平米-1千平米超市</option>
            <option value="7">500平米以下超市</option>
            <option value="8">正规标准连锁</option>
          </select>
          <i class="icon icon-image icon-arrow-down"></i>
       </span>
      </div>
      <div class="form-group form-group-inline liscence">
        <label class="label"><span class="star">*</span>营业执照</label>
        <div class="liscence-image-wrap Pos-r"  ng-click="changeImage('license')">
          <div class="add-btn" ng-if="!profile.license_images || profile.license_images.length<1">
            <span class="icon-plus">+</span>
            <span>上传照片</span>
          </div>
          <img ng-src="{{profile.license_images[0].img_url}}" ng-if="profile.license_images && profile.license_images.length>0">
        </div>
        <!-- <input type="hidden" ng-model="profile.license_image"></input> -->
      </div>
      <div class="form-group form-group-inline shop">
        <label class="label">店铺实景图</label>
        <a href="javascript:void(0);" class="clear-shop-images" ng-click="clearAllShopImages();" ng-if="profile.shop_images && profile.shop_images.length > 0">清空所有实景图</a>
        <div class="shop-images-content clearfix">
          <img ng-src="{{shopImg.img_url}}" ng-repeat="shopImg in profile.shop_images" ng-if="shopImg.img_url" class="shop-item-img">
          <div class="shop-image-wrap Pos-r" ng-click="changeImage('shop')" ng-if="!profile.shop_images || profile.shop_images.length < 10">
            <div class="add-btn">
              <span class="icon-plus">+</span>
              <span>上传照片</span>
            </div>
          </div>
        </div>
        <!-- <input type="hidden" ng-model="profile.license_image"></input> -->
      </div>
      <div ng-if="!requiredOnly" class="form-group form-group-inline password" ng-click="jump('/password');">
        <label class="label">修改密码</label>
        <span class="add-address icon-arrow-right"></span>
      </div>
      <div class="form-group form-group-inline code">
        <label class="label">推荐码</label>
        <input type="text" name="sms" class="bhz-input form-control" ng-model="profile.recommended_code" placeholder="请输入推荐人代码">
      </div>
      <div class="btn-wrap">
        <a href="javascript:void(0);" class="btn btn-submit" ng-click="submit();">提 交</a>
      </div>
    </form>
  </div>
</div>
<script type="text/ng-template" id="confirmDeleteDialog.html">
  <div class="dialog confirm-dialog" ng-click="$event.stopPropagation();">
    <p class="title ngdialog-text-center">确认清空所有店铺实景图吗？</p>
    <div class="ngdialog-buttons">
      <button type="button" class="ngdialog-button ngdialog-button-secondary" ng-click="closeThisDialog(0);$event.stopPropagation()">取消</button>
      <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="confirm(1);$event.stopPropagation()">确认</button>
    </div>
  </div>
</script>
<script type="text/ng-template" id="loading.html">
  <div class="dialog loading-dialog">
    <p class="title ngdialog-text-center">图片正在上传...
      <img src="catalog/view/theme/bhz/m/images/loading.gif">
    </p>
  </div>
</script>
